package com.hmkj.core.api.juhe.bean.epay;

/**
 * Description: 网银支付（CSPAY）返回状态码参数 Succeed 对应消息
 * Created by shiyaxiang on 2017/1/3 16:39.
 */
public enum KjPayErrCode {

    SUCCESS(88,"付款成功"),
    ORDER_NO_ERR(40,"交易退回"),
    REPEAT_IP(41,"交易部分退回"),
    REPEAT_COOKIE(42,"交易处理中"),
    NOT_EXISTS_MERNO(43,"交易失败"),
    MD5KEY_NOT_EXISTS(404,"交易异常");

    private int state;

    private String stateinfo;

    KjPayErrCode(int state , String stateinfo){
        this.state = state;
        this.stateinfo = stateinfo;
    }

    public int getState(){
        return state;
    }

    public String getStateinfo(){
        return stateinfo;
    }

    public static KjPayErrCode stateOf(int index){
        for (KjPayErrCode state : values()) {
            if(state.getState() == index){
                return state;
            }
        }
        return null;
    }
}
